package io;

import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2024-08-15
 * Time: 14:48
 */
public class IOtest {
    public static void main(String[] args) throws IOException {
        File file = new File("./text.txt");
        System.out.println(file.getParent());//返回File对象的父目录文件路径
        System.out.println(file.getName());//返回File对象的文件的纯名称
        System.out.println(file.getPath());//返回File对象的文件路径
        System.out.println(file.getAbsoluteFile());//返回File对象的绝对路径
        System.out.println(file.getCanonicalFile());//返回File对象修饰过的绝对路径
    }
}
